;(function () {
  if (!window.location.host.includes('58corp')) return
  const __dc = document.createElement('script'),
    __s = document.getElementsByTagName('script')[0],
    __url = 'j1.58cdn.com.cn/beidou-sdk/browser/bundle.min.js'
  __dc.type = 'text/javascript'
  __dc.async = false
  __dc.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + __url
  const hashParam = {
    online: {
      projectId: 0, // 必传 ，在58北斗监控平台添加项目时，生成的项目ID
      overtime: 600000,
      beforeSend(event: any) {
        const { apis } = event
        if (Array.isArray(apis) && +apis[0].statusCode === 302) {
          return null
        }
        return event
      }
    }
  }
  __dc.onload = function () {
    window.Beidou && window.Beidou.init(hashParam['online'])
  }
  __s.parentNode && __s.parentNode.insertBefore(__dc, __s)
})()
